using System;
using Castle.ActiveRecord;
using CosyTrade.Data;
using CosyTrade.Security;

namespace CosyTrade.Organization
{
    [Serializable, ActiveRecord("EmployeeRoleRelation")]
    public class EmployeeRoleRelation : BusinessObject
    {
        private Guid primaryKey = Guid.NewGuid();
        private Employee employee;
        private Role role;
        private bool enable;

        [PrimaryKey(PrimaryKeyType.Assigned, "ROWGUID", Access = PropertyAccess.NosetterCamelcase)]
        public Guid PrimaryKey
        {
            get { return primaryKey; }
        }

        [BelongsTo("employeeGuid")]
        public Employee Employee
        {
            get { return employee; }
            set { employee = value; }
        }

        [BelongsTo("roleGuid")]
        public Role Role
        {
            get { return role; }
            set { role = value; }
        }

        [Property]
        public bool Enable
        {
            get { return enable; }
            set { enable = value; }
        }
    }
}